<template>
	<div>
		<div class="flex justify_content_between align_items_center content-wrapper p_lr_20 m_b_20">
			<div class="flex align_items_center">
				<h2>公司历程</h2>
				<div class="p_l_20">
					<el-button size="small" type="primary" @click="isShow1=true">配图设置</el-button>
					<el-button size="small" type="primary" @click="isShow2=true">链接设置</el-button>
				</div>
			</div>
			<div>
				<Language></Language>
			</div>
		</div>


		<!-- -项目列表- -->
		<div class="content-wrapper p_20">
			<el-table :data='tableData' width='100%' >
				<el-table-column label='最后更新时间' prop='updated_at'>
					<template slot-scope="scope">
						{{scope.row.updated_at}}
					</template>
				</el-table-column>
				<el-table-column label='时间' prop='time'>
					<template slot-scope="scope">
						{{scope.row.time}}
					</template>
				</el-table-column>
				<el-table-column label='内容' prop='text'></el-table-column>
				<el-table-column label='排序' prop='sort'></el-table-column>
				<el-table-column label='操作' width="260" prop='sort'>
					<template slot-scope="scope">
						<el-button size="small" @click="edit(scope.row)">编辑</el-button>
						<!-- <el-button size="small" @click="remove(scope.row)">删除</el-button> -->
					</template>
				</el-table-column>
			</el-table>
			<!-- <page ref="Page" :total="total"></page> -->
			<Edit ref="Edit"></Edit>
		</div>
		
		<el-dialog :visible.sync="isShow1" title="配图设置" :close-on-click-modal="false" @close="isShow1=false">
			<!-- <el-divider></el-divider> -->
			<el-form  label-width="80px" class="indexBanner">
				<UploadImg  ref="UploadImg" :upImg = "upImg"></UploadImg>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="isShow1=false">取 消</el-button>
				<el-button type="primary" @click="submit1">确 定</el-button>
			</span>
		</el-dialog>
		
		
		<el-dialog :visible.sync="isShow2" title="链接设置" :close-on-click-modal="false" @close="isShow2=false">
			<!-- <el-divider></el-divider> -->
			<el-form label-width="80px">
				<el-form-item label="链接">
					<el-input v-model="url" class="w_400"></el-input>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="isShow2=false">取 消</el-button>
				<el-button type="primary" @click="submit2">确 定</el-button>
			</span>
		</el-dialog>
	</div>
</template>
<script type="text/javascript">
	import methods from './method'
	import Edit from './edit/edit'

	export default {
		data() {
			return {
				tableData: [], //列表数据
				total: '', //数据总条数  
				language:'cn',
				id:1,
				form:'',
				isShow1:false,
				isShow2:false,
				imageUrl:'',
				url:'',
				upImg:{
					label: '图片',
					imageUrl: '',
					name: 'file',
					width: '1080',
					height: '768',
					file: ''
				}
			}
		},
		methods: methods,
		components:{
			Edit
		},
		mounted() {
			this.getTableData()
		}
	}
</script>
